home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2004 #2 / K-CD-2-2004.ISO / OpenOffice Sv / f_0397 / python-core-2.2.2 / lib / test / test_grp.py < prev    next >
Encoding:
Python Source  |  2003-07-18  |  542 b   |  28 lines

  1. """Test script for the grp module."""
  2.  
  3. # XXX This really needs some work, but what are the expected invariants?
  4.  
  5. import grp
  6. import test_support
  7. import unittest
  8.  
  9.  
  10. class GroupDatabaseTestCase(unittest.TestCase):
  11.  
  12.     def setUp(self):
  13.         self.groups = grp.getgrall()
  14.  
  15.     def test_getgrgid(self):
  16.         entry = grp.getgrgid(self.groups[0][2])
  17.  
  18.     def test_getgrnam(self):
  19.         entry = grp.getgrnam(self.groups[0][0])
  20.  
  21.  
  22. def test_main():
  23.     test_support.run_unittest(GroupDatabaseTestCase)
  24.  
  25.  
  26. if __name__ == "__main__":
  27.     test_main()
  28.